<?php
require_once 'BaseAction.php';

class Event_DistrictController extends TTEvent_Base_Action
{
    public function getAction()
    {
    	$this->_helper->Layout->disableLayout();
        $cid = (int)$this->_getParam('cid');
        $districts = array();
        if ($cid != 0) {
            $key = 'city_districts_' + $cid;
            $districts = $this->getCache($key);
            
            if ( ! $districts) {
                $cityModel = $this->loadModel('City');
                $districts = $cityModel->getDistrictByCity($cid);    
                $this->setCache($key, $districts);
            }               
        }
        $this->view->districts = $districts;
    }   
}

